package com.example.exampleproject.controller;

import com.example.exampleproject.entity.UserScoreEntity;
import com.example.exampleproject.service.UserScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class UserScoreController {

    @Autowired
    UserScoreService userScoreService;


    @RequestMapping("/userScoreList")
    public List<UserScoreEntity> getUserScoreList(){
        List<UserScoreEntity> userScoreList = userScoreService.getUserScoreList();


        return userScoreList;

    }

    @PostMapping("/userScoreListById")
    public List<UserScoreEntity> getUserScoreListById(@RequestBody Map<String,Object> param){
        Integer id = (Integer) param.get("id");
        return userScoreService.getUserScoreListById(id);

    }










}
